<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml">

	<ui:define name="body">
		<h:form>
			<h:panelGrid columns="3">
				<h:outputText value="consultar" styleClass="tituloPagina" />
			|
			<h:commandLink value="Novo Cartao" action="/cartao.xhtml" />
			</h:panelGrid>
			<rich:panel>
				<h:panelGrid columns="4" cellspacing="0" cellpadding="0"
					width="1064">

					<h:column>
						<h:outputLabel value="Cliente" for="cliente" />
						<br />
						<h:inputText id="cliente" />
					</h:column>

					<h:column>
						<h:outputLabel value="Numero" for="numero" />
						<br />
						<h:inputText id="numero" />

					</h:column>
					<h:column>
						<h:outputLabel value="Digito de Verificacao" for="digVerificacao" />
						<br />
						<h:inputText id="digVerificacao" maxlength="3" size="3" />
					</h:column>

					<h:column>
						<h:outputLabel value="Data de Vencimento" for="dataVencimento" />
						<br />
						<a4j:outputPanel id="calendar" layout="block">
							<rich:calendar value="#{cartaoHome.instance.dataVencimento}" popup="true"
								datePattern="MM/yyy" showApplyButton="false" cellWidth="24px"
								cellHeight="22px" style="width:200px" />
						</a4j:outputPanel>
					</h:column>

				</h:panelGrid>
			</rich:panel>
			<br />
			<h:panelGrid columns="3">
				<h:commandButton value="Consultar" />
			|
			<h:commandLink value="Limpar" />
			</h:panelGrid>
			<br />

			<h:messages globalOnly="true" styleClass="message" />

			<rich:spacer height="20" />
			<rich:dataTable id="cartaoList" var="cartao"
				value="#{cartaoList.resultList}" rows="10"
				rendered="#{not empty cartaoList.resultList}">
				<rich:column>
					<f:facet name="header">Cliente</f:facet>
					<s:link id="cartao" value="#{cartao.cliente}" view="/cartao.xhtml">
						<f:param name="cartaoId" value="#{cartao.id}" />
					</s:link>
				</rich:column>
				<rich:column>
					<f:facet name="header">Numero</f:facet> 
                    #{cartao.numero}                  
                </rich:column>
				<rich:column width="10">
					<f:facet name="header">Digito de Verificacao</f:facet> 
                    #{cartao.digVerificacao}                  
                </rich:column>
				<rich:column width="70">
					<f:facet name="header">Data de Vencimento</f:facet>
					<h:outputText value="#{cartao.dataVencimento}">
						<f:convertDateTime type="date" pattern="MM/yyyy" />
					</h:outputText>
				</rich:column>
			</rich:dataTable>
			<rich:datascroller for="cartaoList" maxPages="5"
				renderIfSinglePage="false"
				rendered="#{not empty cartaoList.resultList}" />

			<div class="actionButtons"><s:button id="done"
				value="Incluir Cartao" view="/cartao.xhtml" /></div>

		</h:form>

	</ui:define>

</ui:composition>

